Structural Health Monitoring (SHM)

Working document

Author

Thyge Vinther Ludvigsen, s203591

Published

17 Feb, 2026

1 Problem def: Bayes risk

mostly based on the paper Yang et al. (2022), (pdf)

\[ A_k = \begin{cases} a_{k0} & \text{healthy}\\ a_{k1} & \text{damaged} \end{cases} \] - this is in this formulation bound for an single element

\[ x_e = \text{features from sensors data form configuration } e \]

  • so an \(e\) os the sensor configuration, there leads to vibration data there can be extracted for the surrogate model, \(x_e\) the features extracted from that data,

Prior probability of damage \[ P(A_k|x_e)= \frac{f_{X_e|A_k}(x_e|A_k) P(A_k)} {\sum_{l} f_{X_e|A_l}(x_e|A_l) P(A_l)} \]

  • where \(f_{X_e|A_k}(x_e|A_k)\) is the likelihood of observing features \(x_e\) given the state \(A_k\), and this is obtained from the surrogate model of the structure.
    • the likelihood is an probability function and it can be estimated form monte carlo simulations of the stochastic model of the real structure, where the damage (\(A_k\)) is introduced, but the rest of the model is still the same but whit its stochastic properties.
      • stochastic properties: material properties, the loading, sensor noise, environmental conditions/effects etc.
    • \(A_l\) is all the possible states of the structure for that single element, so in this case “healthy” and “damaged”.
    • the prior probability of damage, \(P(A_k)\) and \(P(A_l)\), can be estimated based on historical data, expert judgment, or a combination of both.
      • another approach is to use Uniform prior: \(P(A_k) = \frac{1}{n}\) where \(n\) is the number of possible states of the structure. In this case, \(n=2\), so \(P(A_k) = 0.5\) for both “healthy” and “damaged” states.

and decision Rule is need to do one of 2 actions:

Define a threshold \(\delta_k\):

\[ \text{Decide damaged if } P(A_k|x_e) > \delta_k \]

Decision variable:

\[ S_k = g_k(x_e) \]

\[ S_k = \begin{cases} \text{inspect} & P(A_k|x_e) > \delta_k \ \text{ignore} & P(A_k|x_e) \le \delta_k \end{cases} \]

  • \(S_k\) is the action with an associated cost. based on what the real state of the structure is.

In the paper have they introduced this costs.

Loss function:

\[ \lambda(S_k, A_k) \]

Expected Cost for One Measurement, this is for one element what is the expected cost of doing an measurement with the sensor configuration \(e\).

\[ L(x_e) = \sum_{A_k} \lambda(g_k(x_e),A_k) P(A_k|x_e) \]

Bayes Risk - Total System Risk:

\[ R(e) = \mathbb{E}_{X_e}[L(x_e)] \]

\[ R(e)=\int L(x_e) f_{X_e}(x_e) dx_e \]

  • this is the expected cost of using the sensor configuration \(e\) for monitoring the structure, and it is calculated by integrating the expected cost \(L(x_e)\) over all possible feature values \(x_e\), weighted by their probability density \(f_{X_e}(x_e)\).
  • Note i think that one confusing part is that \(x_e\) is the features extracted for one sensor configuration, where \(e\) is the sensor configuration, and \(x_e\) is the features extracted from that data. but the features are based on what elements wee look at an if the features are based on an damage state or not dammed state.

Bayesian statistics

\[ P(A|B) = \frac{P(B|A)P(A)}{P(B)} \Rightarrow \text{Posterior} = \frac{\text{Likelihood} \times \text{Prior}}{\text{Evidence}} \]

2 Research Question:

How can sensor placement in structural health monitoring of buildings be optimized by minimizing expected maintenance decision cost rather than maximizing damage detectability?

note: shift form physics optimal monitoring -> decision optimal monitoring.

Sub Questions:

  • How does sensor placement influence damage detection probability?
  • How do detection errors propagate into maintenance decisions? (what are the costs of false positives and false negatives?)
  • What is the economically optimal number and location of sensors?
  • What are the optimal number and type of non-vibration sensors to detect the effect of non-damage related effects (like temperature, humidity, etc.) on the vibration data?
  • When is SHM economically beneficial compared to periodic inspection?

more,

  • Can information be weighted by consequence of failure? (consequence of failure by loss of element)

Not focusing on:

  • Optimal Sensor data processing (onsite vs offsite)
  • Optimal sensor type (vibration vs non-vibration)

2.1 Problem Formulation

2.1.1 Events / categories:

  • \(S\) is the structural information (Stiffness, mass, geometry)
  • \(D \in \{D_0, D_1, D_2, ..., D_k\}\)
    • (D_0) = healthy
    • (D_i) = damage at location (e.g. stiffness reduction)
  • \(L\) is load and environmental conditions acting on the structure (temperature, humidity, wind, etc.)
  • \(x\) is an location on the structure
  • \(a \in \{\text{Do nothing},\ \text{Inspect},\ \text{Repair}\}\)

Sensor are placed at locations \(x\), where the product measurements is given as \(y\). \[ y = f(S, D, L, x) + \varepsilon \]

A damage detection algorithm estimates: \[ P(D_i | y) \]

Cost of decision \(a\) given damage state \(D_i\) is given as \(C(a, D_i)\).

Decision Healthy Damaged
Do nothing 0 Failure risk
Inspect Inspection cost Inspection cost
Repair Unnecessary repair Repair cost

note: this can be expanded to include false positives and false negatives, and the cost of these errors.

Expected decision cost: \[ \mathbb{E}[C | y] = \sum_{i} C(a, D_i) P(D_i | y) \]

2.1.2 Objective: Optimization Problem

chosen number and location of sensors \(x\) to minimize expected decision cost: \[ \boxed{ x^* = \arg\min_x \mathbb{E}[C_{total}(x)] } \]

where total cost includes:

\[ C_{total} = C_{sensors} + C_{false\ alarms} + C_{missed\ damage} + C_{inspection} \]

Expanded:

\[ \mathbb{E}[C_{total}] = C_{install}(x) \cdot P(FP|x)C_{FP} \cdot P(FN|x)C_{FN} \]

3 Focused Literature Review (week 2)

Objective: Extract methods, approaches and key insides form the literature

  • find 3 papers for each of the each topic.

What to focus on:

  • Methods and approaches
    • Input and output of the method
  • Mathematical representation
  • Assumptions
  • justification

Example of my ref:

Cawley (2018) PDF

I cut not get access to this paper, An efficient two-stage method for optimal sensor placement using graph-theoretical partitioning and evolutionary algorithms, but an smart way to find similar information wat to go to “Cited by” this aloes me to go up in the chain of papers there have cited this paper, and find similar papers that have the same or bather method or approach.

{width = 50%}

3.1 General

3.2 Introduction of damage to the structure (D)

3.2.1 Paper 1

Rosafalco et al. (2021), PDF, (reading: skim)

  • there are 2 SHM main approaches:
    • “SHM model model-based”: the update of a numerical model (e.g. through Kalman flters or optimization) [1]
      • Have an hard time whit dealing whit the noise in the data
    • “SHM data-driven”: the use of data to directly estimate damage state (e.g. through machine learning) [2]
      • Supervised learning - ML, labelled data, damage state is known
      • Unsupervised learning - ML, unlabelled data, damage state is unknown
    • Simulation-Based Classification (SBC)” - an hybrid approach, labeled data is created form FEM model [3]
      • need to take varying operational and environmental conditions into account (e.g. temperature, humidity, load, etc.)

3.3 Vibration-based SHM

note: this is both for model model-based and data-driven methods for damage detection.

3.3.1 Paper 1

Sun et al. (2023), PDF, (paper type: review, reading: detailed)

Local and global methods

note: Comments on strengths and weaknesses for each of the 5 methods are given (use them).

  • Vibration-based damage identification methods: [1]
    • natural frequency-based [section 2]
      • hard to distinguish between damage and environmental effects [3]
      • is an example “how to optimize the sampling interval to minimize the effects of measurement noise requires further research.” [4] and [section 2.2] (validates my research question)
    • mode shape-based [section 3] and modal curvature-based [section 3.2]
      • can be used to localize damage
      • ref to 2 papers where they try to use fever sensors to estimate the mode shapes [5]
      • ref to one paper where they down sampled the frequency whiteout losing mode shape [6]
      • sensitive to noise and environmental effects [7], [9]
      • large number of measurement points are needed to accurately estimate mode shapes [8]
      • many papers after [9]
    • Methods Based on Modal Strain Energy - combined methods based on both frequencies and mode shapes. [Section 4]
      • 2 stage model(in many cases): [10]
        • Damage is localized in the first stage by an damage index divided through strain energy, [10]
        • and then the severity of the damage is estimated in the second stage by an optimization optimization algorithms. [10]
        • (note there are references to may papers there cut be of relevance in the end of page 19)
      • Ref. to paper there uses PCA (Principal Component Analysis) - to uncouple collated variables like temperature and damage [11]
      • computationally expensive, for structures whit many elements [12]
      • If error in step 1 then can not be corrected in step 2 [13]
    • Methods Based on Modal Flexibility [section 5]
      • one study shows that the “Methods Based on Modal Flexibility” preform vers when many sensors are used, compared to “Methods curvature based method”, but it is not that sensitive to small damages? [14]
      • an real case study whit temperatures effects on stiffness [15]
      • they conclude that only the first couple of modes are needed to estimate the flexibility matrix and there for is there an need for fewer sensors [16]
      • they conclude that the flexibility based method is not good for damage severity [17]
    • machine learning / data-driven methods / statistical methods [2]
      • they are strong and can be used to filter out the noise and environmental effects, but if there is used supervised learning then there is a need for labeled data, which need much compute (note this is not based on this paper but is an general observation)

general methodology of vibration-based damage detection different Vibration based methods

3.4 Value-of-information-based optimal sensor placemen

3.4.1 Paper 1

Chadha et al. (2025), PDF, reading: detailed (but need more time to understand)

This paper holds allot of information about

  • VoI-based optimal sensor placement
  • Value based sensor placement
  • Economic properties
    • the cost of the sensors
    • the effect of the militance operators risk profiles
    • Some economic matrik close to opportunity cost (but not exactly)
    • ref 32 - is an paper for most of the economic model???
  • Appendix A, on page 28 has an Bayesian optimization algorithm for optimal sensor placement
    • notes they said it was fast, but do not find the optimal solution. (something whit using the sensors for last sensor configuration step????)

note: I think it is mostly the economic models there are relevant i am not sure of the cary over of the to Vibration based structural health monitoring.

note: wiki miter gate monitoring

cost model: 32. Chadha M, Ramancha MK, Vega MA, et al. The modeling of risk perception in the use of structural health monitoring information for optimal maintenance decisions. Reliab Eng Syst Saf 2023; 229: 108845. (pdf) - Inflation rate, behavior of decision makers, Start cost, maintenance cost and operation cost, opportunity cost

The VoI metric over the structure’s lifecycle: expected utility theory (EUT)(pdf) - Expected utility hypothesis - it is an postulates that rational agents maximize utility.

nice summary of imploded methods: page 24 - (pdf)

  • suggestion to use VoI in conjunction whit information based optimal sensor placement to receive an robust system. “This leads us to recommend that VoI-based optimization should be used in conjunction with informationbased optimization. For instance, the first sensor can be optimized to maximize the VoI, while the subsequent additional sensors, conditioned on the first sensor, can be obtained by maximizing information gain.” (Chadha et al., 2025, p. 2116) (pdf)

3.5 ML - based methods for damage detection

3.5.1 paper 1

Aminuddin et al. (2026), (pdf), Reading: fast read all.

“Future research must therefore increasingly focus on Optimal Sensor Placement (OSP) methodologies, which aim to solve the complex combinatorial problem of finding the best sensor locations. To address this, efficient hybrid strategies have been developed. For instance, a twostage method has been proposed that first uses graph-theoretical partitioning to divide the structure into manageable sub-domains, which significantly reduces the computational search space and helps ensure an even distribution of sensors for better mode shape visualization. In the second stage, an evolutionary algorithm is then used to pinpoint the optimal sensor locations within these predefined partitions (Kaveh & Dadras, 2019). Building on this, an even more advanced trend involves embedding machine learning directly into the optimization process itself. Recent work has demonstrated the power of integrating reinforcement learning, specifically Q-learning, with metaheuristic algorithms to create adaptive optimization tools. This approach allows the algorithm to learn from the search process and dynamically select the most effective operators and strategies, leading to superior performance in solving high-dimensional OSP problems for complex structures like large-scale domes (Kaveh et al., 2022).” (Aminuddin et al., 2026, p. 18) (pdf)

3.6 Optimal sensor placement

3.6.1 Paper 0

Wang et al. (2023), (pdf), reading: jumping around

Nice paper, it is an literature review on optimal sensor placement (OSP), it introduces many evaluation criteria and optimization algorithm,

  • they also have some nice short mathematical formulations of the different criteria’s

note: use this paper to explore different OSP sub methods and go in to the relevant criterions.


In the paper is the Binomial coefficient, shown to be used to calculate the number of possible sensor configurations. where n in this case it the number of possible sensor locations and k is the chosen number of sensors, c is then the number of possible sensor configurations.

\[ c = \binom{n}{k} = \frac{n!}{k!(n-k)!} \]


here do they give en example of the work flow for doing OSP, (Wang et al., 2023, p. 2) (pdf)

  1. Determining monitoring objectives according to the structural application.
  2. Determining the type of sensor which is suitable according to the monitoring objective.
  3. Determining parameters such as the number of sensors and the candidate locations of sensors.
  4. Determining evaluation criteria for the optimal placement of sensors.
  5. Determining the optimization algorithm for the optimal arrangement of sensors.
  6. Determining the cost function and the input parameters for the optimization algorithm.
  7. Determining the optimal solution for the sensor placement employing numerous calculations.

Figure 1. General steps of OSP for SHM.
  • In the figure is an overall workflow for doing OSP, whit some criteria examples

until page 9 is there introduced allot of different optimization criteria’s, I am mostly interested in “Probability-Based Damage Detection” (Wang et al., 2023, p. 9) (pdf) probabilistic method aimed at minimizing the expected type 1 and type 2 errors in damage detection.

note: there are many other nice criteria’s, some of them are also probabilistic


3.6.2 Paper 1 (Nice paper, deterministic vibration-based OSP)

Matsushita, Miguel, and Villalba-Morales (2025), (pdf), reading: look-through

Circle-Inspired Optimization Algorithm (CIOA)

  • “everal metaheuristic algorithms have been applied to solve the OSP problem, including Ant Colony Optimization [31], Genetic Algorithms [32], Particle Swarm Optimization [33], Firefly Algorithm, Simulated Annealing [34], Monkey Optimization Algorithm [35], and Wolf Optimization Algorithm [36].” (Matsushita et al., 2025, p. 2) (pdf)
  • “The Fisher Matrix Information (FIM) is one of the main criteria used in the literature as the basis for the objective function. In 1993, Yao et al. [43] were among the first to work in maximizing the determinant of the FIM for a given set of sensors and their positions.”, “planar truss [47]” (Matsushita et al., 2025, p. 2) (pdf)
  • nice link to python code for search algorithms, (Matsushita et al., 2025, p. 8) (pdf)

3.6.3 Paper 2 - Bayesian approach to optimal sensor placement

Flynn and Todd (2010), (pdf), reading: fast


“While these information-based criteria are well suited for problems of inference, SHM’s goal is to reduce the lifetime cost of a structure (in terms of money and/or safety) through both inference and a prior information-based decision making. With this in mind, we believe the OSP for SHM problem requires a Bayesian framework that accounts for the distributed relative costs of type I and type II decision errors. We begin by outlining a general approach to optimal sensor placement by establishing a form of the posterior expected loss (or, less formally, cost) of the detection aspect of an SHM system in terms of the actuator and sensor locations. This formulation of the Bayes risk captures the interplay between actuator/sensor ‘‘coverage’’, the structure’s type I and type II error costs, and the distribution of damage rates. We then manipulate the relative error costs such that the ultimate performance measure is established as the expected total occurrence of either type I or type II error given an application-specific requirement on the other. We form the complete optimal sensor placement algorithm by implementing this performance as the objective function to an appropriate search algorithm. Specifically, we make use of a genetic algorithm to find the error minimizing set of actuator/sensor locations. This framework is intended to be applicable to nearly any type of active or passive SHM system.” (Flynn and Todd, 2010, p. 892) (pdf)


  • nice mathematical formulation of the expected cost of type I and type II errors, given a sensor configuration.

Reference to this paper

3.6.4 Paper 3

nice paper, whit allot of relevant information about Bayesian optimization for optimal sensor placement.

  • In my understanding, do they use the surrogate model of the real work to estimate the probability of detection given an sensor configuration. this is nice but in there problem do they only need static loading for there strain-gauges, to detect damage. where in my problem do i want to use vibration-based sensor damage to make the damage detection, so i Think that the computational cost are much higher for my problem, then for there problem, but the general method and approach could be relevant.
    • i am farad of the computational cost of the method, in vibration-based SHM.
  • they update there syntax quite a bit along the paper, so i need more time to get an god understanding of the last part of the paper.
  • what is the difference between “Bayes risk” and “Bayesian optimization”?
  • what is the mathematical meaning of “;”
  • how can \(f_{X_e}(x_e)\) be calculated? it seems abetter?

An optimal sensor placement design framework for structural health monitoring using Bayes risk

Yang et al. (2022), (pdf)


work flow in the paper:

  • Step 1: chose sensor types there are suitable, for extracting features there are correlated to the damage states of interest
  • Step 2: optimize the sensor system there give the most valuable information at the minimal cost.

relevant quotes:

  • “the first step of the SHM system design is to decide what suitable sensors (e.g., strain-gauges, accelerators, etc.) provide measurements from which the extracted features are correlated to the type of damage or state to be inferred.” (Yang et al., 2022, p. 2) (pdf)
  • “The second step is then to obtain a sensor network design (e.g., number of sensors, location/placement, duty cycle, etc.) that provides the most valuable information at a minimal cost [13–15].” (Yang et al., 2022, p. 2) (pdf)

“We address three implementation-based challenges:

    1. Bayesian calibration of the discrete parameters defining the damage state;
    1. the expensive evaluation of Bayes risk; and
    1. the global optimization of an extremely high-dimensional design space informing Bayes risk. ”

(Yang et al., 2022, p. 3) (pdf)

“Bayesian decision-making, the goal is to arrive at a decision that minimizes the expected risk (also referred to as Bayes risk in this paper) or expected loss.” (Yang et al., 2022, p. 3) (pdf)


3.6.4.1 Bayes risk for decision-making

wiki math syntax

given:

  • \(X : S_x \rightarrow \Omega_x \subset \mathbb{R}\)
    • The random variable \(X(x)\) is an function that maps from the sample space \(S_x\) to the real numbers \(\Omega_x\) where \(x\) is the relation of \(X\).
      • \(S_x\) is the sample space of \(X\), (this do not have to be real numbers, it can be any set of possible outcomes, e.g. {healthy, damaged})
      • \(\Omega_x\) is the set of all possible values that \(X\), (this is the corresponding real numbers the the outcomes in \(S_x\))
    • “:” is “such that” in set notation

rep:

  • \(\Omega_x\) represents the measurement space
  • \(\Omega_y\) represents the true state space, whit the corresponding random variable \(Y : S_y \rightarrow \Omega_y \subset \mathbb{R}\)
    • whit \(M\) Classes where \(M=2\) given ass either “the structure is damaged” or “the structure is healthy”
  • \(g(x)\) is and function the maps \(x\) to the sample space \(\Omega_g \in \{0, 1, ..., i \}\), where \(i = \{0, 1, ..., M-1\}\)
    • so \(g(x)\) is the trained classifier that maps measurements \(x\) to the corresponding damage state class \(i\)
    • Note i think they also want \(g(x)\) to be represented ass \(G\)

note: \(g_0\) is the prediction of an true damage state and \(y_0\) is the true damage state.

“Bayes risk is designed such that it minimizes the effects of incorrect decisions. This is done by incorporating a loss function” (Yang et al., 2022, p. 4) (pdf)

\[ L(g(x), y) : \Omega_g \times \Omega_y \rightarrow \mathbb{R} \]

  • \(L(g(x), y)\) defines the loss function that maps the predicted class \(g(x)\) and the true class \(y\) to a real number representing the cost of making an incorrect decision.
  • in set theory is “times” “\(\times\)” the Cartesian product, which is the total outcome-space of the combinations of the 2 random variables. mathematical \(A \times B = \{(a,b) \mid a \in A, b \in B\}\)

Equation 2-4. (Yang et al., 2022, p. 4) (pdf)


section 2.2: Bayes risk for design selection and optimal sensing framework (pdf)

  • now let \(e\) be and design configuration, where \(e \in \Omega_e\) is the set of all possible design configurations.
  • now can \(x_e\) be and measurement/Relation based on the design configuration \(e\)

this means the the conditional density function (likelihood function) of the measurements given the true state and design configuration can be represented as \(f_{X_e|y}(x_e | y)\).

See Equation 5a, 5b: (pdf)


Step 1: Problem description

“problem description consists of defining the decision space, the true state space, the measurement (or feature) space, and the design space.” (Yang et al., 2022, p. 5) (pdf)

  • one option is to define discrete “decision space adn true state state space” \(\Omega_G, \Omega_y\)
    • this can be don by marking damage under 10% as “healthy” and damage over 10% bunt under 30% as “moderately damaged” and damage states over 30% as “severely damaged”
  • the measurement space \(e\) do also need to be defined, so the structure need to be discretized into a finite number of possible sensor locations.

Step 2:


Step 3: Evaluation of the design-dependent Bayes risk functional

  • the prior probability \(f_Y(y_i)\) is given as 0.5 in this paper because they only have 2 classes.
  • the likelihood function \(f_{X_e|y}(x_e | y)\) obtained using either a physics-based model or a digital twin.
  • the posterior probability \(f_{G|X_e}(g(x_e; e) | x_e)\) can be fund by the law of total probability in the discrete case be is it given as and sum over all the possible true states.

in equation 6 is the posterior probability (pdf)

in equation 7 is updating the updating of the posterior.


Step 4: Obtaining the optimal sensor design using Bayesian optimization

the and optimization framework they chose “expected improvement”, for finding the optimal sensor design \(e^*\) that minimizes the Bayes risk functional.


here is an figure there shows the work flow


  • “We obtain the measurement data xe using Finite Element Model (FEM) developed using OpenSees [38] or using a surrogate model developed using Gaussian Process Regression (GPR) [35].” (Yang et al., 2022, p. 9) (pdf)
  • “However, for more complicated problems with correlated measurement values and continuous decision space, evaluation of the likelihood and the posterior will be more involved. For instance, in such cases, we use numerical techniques like Markov Chain Monte Carlo (MCMC), Sequential Monte Carlo (SMC) (refer to [41]), or other methods to evaluate posterior.” (Yang et al., 2022, p. 9) (pdf)

  • “4.2. Finite element and surrogate model” (Yang et al., 2022, p. 9) (pdf)
    • Set up for making an surrogate model for the FEM model?

Bayesian statistics

\[ P(A|B) = \frac{P(B|A)P(A)}{P(B)} \Rightarrow \text{Posterior} = \frac{\text{Likelihood} \times \text{Prior}}{\text{Evidence}} \]

4 Nice to read

- OSP on an real bridge, Discussing optimal sensor placement for ambient vibration test of an existing bridge

Bayes updating for OSP

5 Simple testing

5.1 Simple cantilever beam

Code
# Import OpenSeesPy and other libraries
import openseespy.opensees as ops
import numpy as np
import matplotlib.pyplot as plt

# ---------------------------
# 1. Wipe any existing model
# ---------------------------
ops.wipe() # Clear any existing model 
# Define model builder: 2D, 3 DOFs per node (Ux, Uy, rotation)
ops.model('basic', '-ndm', 2, '-ndf', 3)  # 2D, 3 DOFs per node (Ux, Uy, rotation)

# ---------------------------
# 2. Define beam geometry
# ---------------------------
L = 10.0  # Total length of cantilever (m)
num_elements = 10
num_nodes = num_elements + 1
element_length = L / num_elements

# create nodes - Node coordinates
for i in range(num_nodes):
    ops.node(i+1, i*element_length, 0.0) # (Node tag, x-coordinate, y-coordinate)

# set boundary condition - Fix left end (cantilever)
ops.fix(1, 1, 1, 1)  # (node , Ux, Uy, Rotation fixed)

# ---------------------------
# 3. Material & Section
# ---------------------------
E = 210e9       # Young's modulus (Pa)
A = 0.01        # Cross-sectional area (m^2)
I = 8.333e-6    # Moment of inertia (m^4)
rho = 7800      # Density (kg/m^3)

# Define material
ops.nDMaterial("ElasticIsotropic", 1, E, 0.3, rho) # (type, tag, E, nu, rho)

# Define elastic beam section
ops.section("Elastic", 1, E, A, I) # (type, tag, E, A, I)

# Coordinate transformation for beam elements
ops.geomTransf("Linear", 1) # (type, tag)

# ---------------------------
# 4. Define beam elements
# ---------------------------
for i in range(num_elements):
    # (element, tag,  node i, node j, A, E, I, transfTag ??, '-mass', mass per unit length)
    ops.element('elasticBeamColumn', i+1, i+1, i+2, A, E, I, 1, '-mass', rho*A*element_length)

    """ this is the other way to define mass"""
    # add mass to each element for dynamic analysis
    # ops.mass(i+1, rho*A*element_length, 0.0, 0.0) # (node, mass in Ux, mass in Uy, mass in rotation)

5.1.1 Find mode shapes

Code
# ---------------------------
# 5. Eigenvalue Analysis
# ---------------------------
num_modes = 5
eigenvalues = ops.eigen(num_modes)
frequencies = [np.sqrt(val)/(2*np.pi) for val in eigenvalues]  # Convert rad/s to Hz
print("Natural Frequencies (Hz):", np.round(frequencies, 3))

# ---------------------------
# 6. Extract mode shapes
# ---------------------------
mode_shapes = []
for mode in range(num_modes):
    shape = []
    for node in range(1, num_nodes+1):
        # Use nodeEigenvector instead of nodeDisp
        uy = ops.nodeEigenvector(node, mode+1, 2) # (node, mode, dof) - dofs= (Ux=1, Uy=2, Rotation=3)
        shape.append(uy)
    mode_shapes.append(shape)

mode_shapes = np.array(mode_shapes)


# ---------------------------
# 7. Plot mode shapes
# ---------------------------
x = np.linspace(0, L, num_nodes)

plt.figure(figsize=(4,6))
for i in range(num_modes):
    plt.plot(mode_shapes[i]/np.max(np.abs(mode_shapes[i])), x, label=f'Mode {i+1}')
plt.ylabel("Beam length (m)")
plt.xlabel("Normalized vertical displacement")
plt.title("Cantilever Beam Mode Shapes")
plt.legend()
plt.grid(True)
plt.show()
Natural Frequencies (Hz): [ 0.834  5.171 14.333 27.794 45.434]

Citations

Aminuddin, Ahmad Kamil, Sakhiah Abdul Kudus, Adiza Jamadin, Mohamad Farid Misnan, Zainorizuan Mohd Jaini, and Akihiko Sato. 2026. “Emerging Trends in Machine Learning Applications for Structural Health Monitoring of Bridges.” Asian Journal of Civil Engineering 27 (1): 1–21. https://doi.org/10.1007/s42107-025-01511-8.
Cawley, Peter. 2018. “Structural Health Monitoring: Closing the Gap Between Research and Industrial Deployment.” Structural Health Monitoring 17 (5): 1225–44. https://doi.org/10.1177/1475921717750047.
Chadha, Mayank, Zhen Hu, Charles R. Farrar, and Michael D. Todd. 2025. “A Value-of-Information-Based Optimal Sensor Placement Design Framework for Cost-Effective Structural Health Monitoring (with Application to Miter Gate Monitoring).” Structural Health Monitoring 24 (4): 2091–2124. https://doi.org/10.1177/14759217241275643.
Flynn, Eric B., and Michael D. Todd. 2010. “A Bayesian Approach to Optimal Sensor Placement for Structural Health Monitoring with Application to Active Sensing.” Mechanical Systems and Signal Processing 24 (4): 891–903. https://doi.org/10.1016/j.ymssp.2009.09.003.
Matsushita, Kristian Y., Letícia Fleck Fadel Miguel, and Jesús D. Villalba-Morales. 2025. “Optimal Sensor Placement for Modal Identification of Large Truss Structures Using the Circle-Inspired Optimization Algorithm.” Evolutionary Intelligence 18 (6): 117. https://doi.org/10.1007/s12065-025-01098-8.
Rosafalco, Luca, Matteo Torzoni, Andrea Manzoni, Stefano Mariani, and Alberto Corigliano. 2021. “Online Structural Health Monitoring by Model Order Reduction and Deep Learning Algorithms.” Computers & Structures 255 (October): 106604. https://doi.org/10.1016/j.compstruc.2021.106604.
Sun, Xutao, Sinniah Ilanko, Yusuke Mochida, and Rachael C. Tighe. 2023. “A Review on Vibration-Based Damage Detection Methods for Civil Structures.” Vibration 6 (4): 843–75. https://doi.org/10.3390/vibration6040051.
Wang, Ying, Yue Chen, Yuhan Yao, and Jinping Ou. 2023. “Advancements in Optimal Sensor Placement for Enhanced Structural Health Monitoring: Current Insights and Future Prospects.” Buildings 13 (12). https://doi.org/10.3390/buildings13123129.
Yang, Yichao, Mayank Chadha, Zhen Hu, and Michael D. Todd. 2022. “An Optimal Sensor Placement Design Framework for Structural Health Monitoring Using Bayes Risk.” Mechanical Systems and Signal Processing 168 (April): 108618. https://doi.org/10.1016/j.ymssp.2021.108618.